package com.demo.study.thread;

/**
 * @author leiliang
 * @version 1.0
 * @Description  wait属于Object的方法  只能对象.wait
 * @date 2021/1/7 14:22
 */
public class Thread006 {

    public static void main(String[] args) {
        new Thread006().start();
    }

    private synchronized void start() {
        try {
            wait(3000);
            System.out.println("哈哈");
        }catch (Exception e){
            e.printStackTrace();
        }
    }

  /*  //synchronized这里是this锁   执行错误
    private synchronized void start() {
        try {
            new Thread006().wait();
        }catch (Exception e){
            e.printStackTrace();
        }
    }*/
}
